package com.itheima.stock.config;

import com.google.common.util.concurrent.RateLimiter;
import com.itheima.stock.properties.RateLimiterProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author:gzc
 * @Date: 2025/10/23 21:28
 * @Description:
 */
@Configuration
@SuppressWarnings("all")
public class RateLimiterConfiguration {

    @Bean
    public RateLimiter rateLimiter(RateLimiterProperties properties){
        return RateLimiter.create(properties.getConcurrentNum());
    }
}
